<?php 
/**
 * Bookings Template for Room Booking component
 */
defined('_JEXEC') or die('Restricted access');
?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
    <table class="adminlist">
    <thead>
        <tr>
        	 <th width="5">
                <?php echo JText::_( '#' ); ?>
            </th>
        	<th width="20">
              <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
            </th>
            <th >
                <?php echo JText::_( 'SHORTDESC' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'START' ); ?>
            </th>
            <th >
                <?php echo JText::_( 'END' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'ROOM' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'USER' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'SERIES' ); ?>
            </th>
              <th width="5">
                <?php echo JText::_( 'ID' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Total' ); ?>
            </th>
        </tr>            
    </thead>
    <?php
    $k = 0;
     for ($i=0, $n=count( $this->items ); $i < $n; $i++)
    {
        $row =& $this->items[$i];
        $checked    = JHTML::_( 'grid.id', $i, $row->id );
        $link = 'index.php?option=com_roombooking&controller=booking&task=edit&cid='. $row->id ;
        ?>
        <tr class="<?php echo "row$k"; ?>">
        	<td>
              <?php echo $i+1; ?>
            </td>
             <td>
              <?php echo $checked; ?>
            </td>
            
             <td>
              	<a href="<?php echo $link; ?>"><?php echo $row->short_description; ?></a>
            </td>
            <td>
                <?php echo $row->start; ?> 
            </td>
             <td>
                <?php echo $row->end; ?>
            </td>
             <td>
             	<a href="<?php echo 'index.php?option=com_roombooking&controller=room&task=edit&cid='.$row->room_id; ?>">
                <?php echo $row->room_id." - ". $row->room_name;?></a>
            </td>
             <td>
                <?php echo JFactory::getUser($row->id_user)->name; ?>
            </td>
            <td>
               <?php if (isset($row->series)) echo '<a href="index.php?option=com_roombooking&controller=booking&task=removeSeries&series='.$row->series.'">delete</a>';?>
            </td>
            <td>
                <?php echo $row->id; ?>
            </td>
            <td>
                <?php echo $row->total; ?>
            </td>
        </tr>
        <?php
        $k = 1 - $k;
    }
    ?>
    </table>
</div>
 
<input type="hidden" name="option" value="com_roombooking" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="booking" />
 
</form>
